﻿using NHibernate.Mapping.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceZero.DataStore.Models
{
    /// <summary>
    /// 
    /// </summary>
    [Class(Table = "IceZero_ShortLink")]//定义数据库表名
    public class ShortLink
    {
        /// <summary>
        /// 主键值
        /// </summary>
        [Id(0, Name = "Id", TypeType = typeof(string), Length = 255)]
        [Key(1)]
        [Generator(2, Class = "uuid.hex")]
        public virtual string Id { get; set; }
        /// <summary>
        /// 自定义 code
        /// </summary>
        [Property(Column = "Code", TypeType = typeof(string), Length = 1000)]
        public virtual string Code { get; set; }
        /// <summary>
        /// 原始url
        /// </summary>
        [Property(Column = "RawUrl", TypeType = typeof(string), Length = 1000)]
        public virtual string RawUrl { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Property(Column = "CreateTime", TypeType = typeof(DateTime))]
        public virtual DateTime CreateTime { get; set; }
        /// <summary>
        /// 过期时间
        /// </summary>
        [Property(Column = "ExpireTime", TypeType = typeof(DateTime))]
        public virtual DateTime ExpireTime { get; set; }
    }
}
